#!/bin/sh

patch()
{
	for FILE in $1
	do
		if [ "$FILE" != "changeNom" ]; then
			FILE_NEW=$FILE"_new"
			sed -e 's/$2/$3/g' $FILE > $FILE_NEW
			rm -f $FILE
			mv $FILE_NEW $FILE
			echo $FILE" mis à jour"
		fi
	done
}

FILES=`python changeNom.py amanda`
patch $FILES "amanda" "coMexpert"

FILES=`python changeNom.py AMANDA`
patch $FILES "AMANDA" "COMEXPERT"

FILES=`python changeNom.py amanda ./designer`
patch $FILES "amanda" "coMexpert"

FILES=`python changeNom.py AMANDA ./designer`
patch $FILES "AMANDA" "COMEXPERT"